// 防抖

export default function (fn, duration = 50) {
    let time = null;
    return (...args) => {
        clearTimeout(time);
        time = setTimeout(() => {
            fn(...args)
        }, duration);
    }
}